import http from '@/axios/http.ts'
import { createRoleInfoRequest,allocationMenuRequest } from "@/models/permissionsModles.ts";

/**
 * 添加角色
 * @param {*} p 
 * @returns 
 */
export const createRole = (props: createRoleInfoRequest) => {
    return http.post('/Permissions/CreateRole', props);
}

/**
 * 根据角色id获取授权菜单id
 * @param {*} p 
 * @returns 
 */
export const getMenuIdsById = (props: String) => {
    return http.get('/Permissions/GetMenuIdsById', props);
}

/**
 * 授权菜单给角色
 * @param {*} p 
 * @returns 
 */
export const grantMenuToRole = (props: allocationMenuRequest) => {
    return http.post('/Permissions/GrantMenuToRole', props);
}